package com.itheima.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
/*
Stream 流的中间方法
 */
public class Demo02 {

    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>(List.of("鹿晗", "黄子韬", "张艺兴", "张艺兴"));
        Stream<String> stream = list.stream();
        //stream.filter(x->x.length()==3).forEach(x-> System.out.println(x));
        stream.filter(x->x.length()==3)
                .filter(x->x.startsWith("张"))
                .forEach(x-> System.out.println(x));

    }
}
